import { REGEX_SORT } from '@/utils/validate'

const rules = {
  matchStar: [
    {
      type: 'array',
      required: true,
      message: '请选择匹配星级',
      trigger: 'change'
    }
  ],
  name: [
    {
      required: true,
      message: '请输入标签名称',
      trigger: 'blur'
    },
    {
      max: 8,
      message: '最多输入8个字'
    }
  ],
  sort: [
    {
      required: true,
      message: '请输入显示顺序',
      trigger: 'blur'
    },
    {
      pattern: REGEX_SORT,
      message: '显示顺序在1-9999之间'
    }
  ]
}

export default rules
